
#include <config.h>
typedef struct
{
	unsigned short ddr_clk;
	//ctl ac timing
	unsigned short CKE_INACTIVE;
	unsigned short CKE_DELAY;
	unsigned short CKSRE;
	unsigned short CKSRX;
	unsigned short TRST_PWRON;
	unsigned short TBST_INT_INTERVAL;
	unsigned short TCAEXT;
	unsigned short TCACKEL;
	unsigned short TCACKEH;
	unsigned short TCAENT;
	unsigned short TCAMRD;
	unsigned short TCCD;
	unsigned short TCCDMW;
	unsigned short TCKCKEL;
	unsigned short TCKE;
	unsigned short TCKEHCMD;
	unsigned short TCKELCMD;
	unsigned short TCKELPD;
	unsigned short TCKELCS;
	unsigned short TCKEHCS;
	unsigned short TCKESR;
	unsigned short TCKFSPX;
	unsigned short TCKFSPE;
	unsigned short TCMDCKE;
	unsigned short TCSCKE;
	unsigned short TCSCKEH;
	unsigned short TDAL;
	unsigned short TDQSCK_MIN;
	unsigned short TDQSCK_MAX;
	unsigned short TESCKE;
	unsigned short TFAW;
	unsigned short TFC;
	unsigned int TINIT;
	unsigned int TINIT3;
	unsigned int TINIT4;
	unsigned int TINIT5;
	unsigned short TMRR;
	unsigned short TMRZ;
	unsigned short TMOD;
	unsigned short TMRD;
	unsigned short TMRRI;
	unsigned short TMRWCKEL;
	unsigned short TPDEX;
	unsigned short TPPD;
	unsigned short TREF_INTERVAL;
	unsigned short TRAS_MAX;
	unsigned short TRAS_MIN;
	unsigned short TRP_AB;
	unsigned short TRC;
	unsigned short TRCD;
	unsigned short TRP;
	unsigned short TREF;
	unsigned short TRFC;
	unsigned short TRRD;
	unsigned short TRTP;
	unsigned short TSR;
	unsigned short TVRCG_DISABLE;
	unsigned short TVRCG_ENABLE;
	unsigned short TVREF_LONG;
	unsigned short TWR;
	unsigned short TWTR;
	unsigned short TXSNR;
	unsigned short TXSR;
	unsigned short TZQCAL;
	unsigned short TZQCKE;
	unsigned short TZQLAT;
	unsigned short WLMRD;
	unsigned short WLDQSEN;
	//ctl odt
	unsigned short ODT_EN;
	unsigned short RD_TO_ODTH;
	unsigned short WR_TO_ODTH;
	unsigned short TODTL_2CMD;
	unsigned short TODTH_RD;
	unsigned short TODTH_WR;
	//ctl low power
	unsigned short LP_AUTO_PD_IDLE;
	unsigned short LP_AUTO_SR_IDLE;
	unsigned short LP_AUTO_SR_MC_GATE_IDLE;
	unsigned short LP_AUTO_SRPD_LITE_IDLE;
	unsigned short LPI_PD_WAKEUP;
	unsigned short LPI_SR_MCCLK_GATE_WAKEUP;
	unsigned short LPI_SR_WAKEUP;
	unsigned short LPI_SRPD_DEEP_MCCLK_GATE_WAKEUP;
	unsigned short LPI_SRPD_DEEP_WAKEUP;
	unsigned short LPI_SRPD_LITE_WAKEUP;
	unsigned short LPI_TIMER_COUNT;
	unsigned short LPI_TIMER_WAKEUP;
	unsigned short LPI_WAKEUP_TIMEOUT;
	//ctl delay&latency
	unsigned short CASLAT_LIN;
	unsigned short DLL_RST_ADJ_DLY;
	unsigned short DLL_RST_DELAY;
	unsigned short RDLAT_ADJ;
	unsigned short R2R_DIFFCS_DLY;
	unsigned short R2R_SAMECS_DLY;
	unsigned short R2W_DIFFCS_DLY;
	unsigned short R2W_SAMECS_DLY;
	unsigned short RW2MRW_DLY;
	unsigned short WRLAT;
	unsigned short WRLAT_ADJ;
	unsigned short W2R_DIFFCS_DLY;
	unsigned short W2R_SAMECS_DLY;
	unsigned short W2W_DIFFCS_DLY;
	unsigned short W2W_SAMECS_DLY;
	//ctl dfi
	unsigned short TDFI_CALVL_CAPTURE;
	unsigned short TDFI_CALVL_CC;
	unsigned short TDFI_CALVL_EN;
	unsigned short TDFI_CALVL_MAX;
	unsigned short TDFI_CALVL_RESP;
	unsigned short TDFI_CTRL_DELAY;
	unsigned short TDFI_CTRLUPD_INTERVAL;
	unsigned short TDFI_CTRLUPD_MAX;
	unsigned short TDFI_CTRLUPD_MIN;
	unsigned short TDFI_DRAM_CLK_DISABLE;
	unsigned short TDFI_DRAM_CLK_ENABLE;
	unsigned short TDFI_INIT_COMPLETE;
	unsigned short TDFI_INIT_START;
	unsigned short TDFI_LP_RESP;
	unsigned short TDFI_PHY_RDLAT;
	unsigned short TDFI_PHY_WRDATA;
	unsigned short TDFI_PHY_WRLAT;
	unsigned short TDFI_PHYMSTR_RESP;
	unsigned short TDFI_PHYMSTR_MAX;
	unsigned short TDFI_PHYUPD_RESP;
	unsigned short TDFI_PHYUPD_TYPE0;
	unsigned short TDFI_PHYUPD_TYPE1;
	unsigned short TDFI_PHYUPD_TYPE2;
	unsigned short TDFI_PHYUPD_TYPE3;
	unsigned short TDFI_RDDATA_EN;
	unsigned short TDFI_RDLVL_EN;
	unsigned short TDFI_RDLVL_MAX;
	unsigned short TDFI_RDLVL_RESP;
	unsigned short TDFI_RDLVL_RR;
	unsigned short TDFI_RDCSLAT;
	unsigned short TDFI_WRCSLAT;
	unsigned short TDFI_WRLVL_WW;
	unsigned short TDFI_WRLVL_EN;
	unsigned short TDFI_WRLVL_RESP;
	unsigned short TDFI_WRLVL_MAX;
	//ctl zq
	unsigned short ZQ_CALLATCH_TIMEOUT;
	unsigned short ZQ_CALLATCH_HIGH_THRESHOLD;
	unsigned short ZQ_CALSTART_HIGH_THRESHOLD;
	unsigned short ZQ_CALSTART_TIMEOUT;
	unsigned short ZQ_CALSTART_NORM_THRESHOLD;
	unsigned short ZQ_CS_HIGH_THRESHOLD;
	unsigned short ZQ_CS_NORM_THRESHOLD;
	unsigned short ZQ_PROMOTE_THRESHOLD;
	unsigned short ZQ_CS_TIMEOUT;
	unsigned short ZQCS;
	unsigned short ZQCL;
	unsigned short ZQINIT;
	unsigned short ZQRESET;
	//ctl mode register
	unsigned short MR1_DATA;
	unsigned short MR2_DATA;
	unsigned short MR3_DATA;
	unsigned short MR11_DATA;
	unsigned short MR12_DATA;
	unsigned short MR14_DATA;
	unsigned short MR22_DATA;
	unsigned short MRR_TEMPCHK_HIGH_THRESHOLD;
	unsigned short MRR_TEMPCHK_TIMEOUT;
	unsigned short MRR_TEMPCHK_NORM_THRESHOLD;
	unsigned short MRR_PROMOTE_THRESHOLD;
	unsigned short MRW_PROMOTE_THRESHOLD;
	//ctl others
	unsigned short CA_DEFAULT_VAL;
	unsigned short DFS_PROMOTE_THRESHOLD;
	unsigned short HW_PROMOTE_THRESHOLD;
	unsigned short LPC_PROMOTE_THRESHOLD;
	unsigned short PHYMSTR_DFI_PROMOTE_THRESHOLD;
	unsigned short UPD_CTRLUPD_NORM_THRESHOLD;
	unsigned short UPD_CTRLUPD_HIGH_THRESHOLD;
	unsigned short UPD_CTRLUPD_TIMEOUT;
	unsigned short UPD_CTRLUPD_SW_PROMOTE_THRESHOLD;
	unsigned short UPD_PHYUPD_DFI_PROMOTE_THRESHOLD;
}CANDS_CTL_TIMING_T;

typedef struct
{
	unsigned int ddr_clk;
	//pi ac timing
	unsigned short PI_CASLAT_LIN_Fx;
	unsigned short PI_RDLAT_ADJ_Fx;
	unsigned short PI_WRLAT_Fx;
	unsigned short PI_WRLAT_ADJ_Fx;
	unsigned short PI_TCACKEL;
	unsigned short PI_TCAMRD;
	unsigned short PI_TCACKEH;
	unsigned short PI_TCAENT;
	unsigned short PI_TCAEXT;
	unsigned short PI_TCCD;
	unsigned short PI_TCCDMW_Fx;
	unsigned short PI_TCKCKEH;
	unsigned short PI_TCKEHDQS_Fx;
	unsigned short PI_TDQSCK_MAX_Fx;
	unsigned short PI_TDELAY_RDWR_2_BUS_IDLE_Fx;
	unsigned short PI_TFC_Fx;
	unsigned short PI_TMRD_Fx;
	unsigned short PI_TMRR;
	unsigned short PI_TMRW_Fx;
	unsigned short PI_TMRZ_Fx;
	unsigned int PI_TRAS_MAX_Fx;
	unsigned int PI_TRAS_MIN_Fx;
	unsigned short PI_TRCD_Fx;
	unsigned int PI_TREF_Fx;
	unsigned int PI_TREF_INTERVAL;
	unsigned int PI_TRFC_Fx;
	unsigned short PI_TRP_Fx;
	unsigned short PI_TRTP_Fx;
	unsigned short PI_TVREF_SHORT_Fx;
	unsigned short PI_TVREF_LONG_Fx;
	unsigned short PI_TWR_Fx;
	unsigned short PI_TWTR_Fx;
	//pi dfi timing
	unsigned short PI_TDFI_PHYUPD_RESP_Fx;
	unsigned int PI_TDFI_PHYUPD_TYPE0_Fx;
	unsigned int PI_TDFI_PHYUPD_TYPE1_Fx;
	unsigned int PI_TDFI_PHYUPD_TYPE2_Fx;
	unsigned int PI_TDFI_PHYUPD_TYPE3_Fx;
	unsigned int PI_TDFI_PHYMSTR_MAX_Fx;
	unsigned int PI_TDFI_PHYMSTR_RESP_Fx;
	unsigned short PI_TDFI_CTRL_DELAY_Fx;
	unsigned short PI_TDFI_WRLVL_EN;
	unsigned short PI_TDFI_WRLVL_WW;
	unsigned short PI_TDFI_WRLVL_RESP;
	unsigned short PI_TDFI_WRLVL_MAX;
	unsigned short PI_TDFI_RDLVL_EN;
	unsigned short PI_TDFI_RDLVL_RR;
	unsigned short PI_TDFI_RDLVL_RESP;
	unsigned short PI_TDFI_RDLVL_MAX;
	unsigned short PI_TDFI_RDDATA_EN;
	unsigned short PI_TDFI_WRCSLAT_Fx;
	unsigned short PI_TDFI_PHY_WRDATA;
	unsigned short PI_TDFI_CALVL_EN;
	unsigned short PI_TDFI_CALVL_CC_Fx;
	unsigned short PI_TDFI_CALVL_CAPTURE_Fx;
	unsigned short PI_TDFI_CALVL_RESP;
	unsigned short PI_TDFI_CALVL_MAX;
	unsigned short PI_TDFI_CALVL_STROBE_Fx;
	unsigned short PI_TDFI_CACSCA_Fx;
	unsigned short PI_TDFI_CASEL_Fx;
	unsigned short PI_TDFI_INIT_START_MIN;
	unsigned short PI_TDFI_INIT_COMPLETE_MIN;
	unsigned short PI_TDFI_INIT_START_Fx;
	unsigned short PI_TDFI_INIT_COMPLETE_Fx;
	unsigned short PI_TDFI_WDQLVL_WR;
	unsigned short PI_TDFI_WDQLVL_RW;
	unsigned short PI_TDFI_WDQLVL_EN;
	unsigned short PI_TDFI_WDQLVL_RESP;
	unsigned short PI_TDFI_WDQLVL_MAX;
	unsigned short PI_TDFI_CTRLUPD_MAX_Fx;
	unsigned int PI_TDFI_CTRLUPD_INTERVAL_Fx;
	unsigned short PI_INIT_STARTORCOMPLETE_2_CLKDISABLE;
	unsigned short PI_CLKDISABLE_2_INIT_START;
	//pi odt timing
	unsigned short PI_ODT_EN_Fx;
	unsigned short PI_ODTLON_Fx;
	unsigned short PI_TODTH_WR;
	unsigned short PI_TODTH_RD;
	unsigned short PI_TODTL_2CMD_Fx;
	unsigned short PI_TODTON_MIN_Fx;
	unsigned short PI_WR_TO_ODTH_Fx;
	unsigned short PI_RD_TO_ODTH_Fx;
	//pi mode register
	unsigned short PI_MR1_DATA_Fx;
	unsigned short PI_MR2_DATA_Fx;
	unsigned short PI_MR3_DATA_Fx;
	unsigned short PI_MR11_DATA_Fx;
	unsigned short PI_MR12_DATA_Fx;
	unsigned short PI_MR14_DATA_Fx;
	unsigned short PI_MR13_DATA_CSm;
}CANDS_PI_TIMING_T;

typedef struct
{
	unsigned int ddr_clk;
	//pll
	unsigned int phy_pll_ctrl;
	//Address/Control Slice
	unsigned short phy_adr_master_delay_start;
	unsigned short phy_adr_master_delay_step;
	unsigned short phy_adr_master_delay_wait;
	unsigned short phy_adr_sw_master_mode;
	unsigned short phy_grp_slave_delay_Z;
	//Data Slice Parameters for clk_wr settings
	unsigned short phy_clk_wrdm_slave_delay_X;
	unsigned short phy_clk_wrdqZ_slave_delay_X ;
	unsigned short phy_clk_wrdqs_slave_delay_X;
	//Data Slice Parameters for DQ
	unsigned short phy_dq_ie_timing_X;
	unsigned short phy_dq_oe_timing_X;
	unsigned short phy_dq_tsel_rd_timing_X;
	unsigned short phy_dq_tsel_wr_timing_X;
	//Data Slice Parameters for DQS
	unsigned short phy_dqs_ie_timing_X;
	unsigned short phy_dqs_oe_timing_X;
	unsigned short phy_dqs_tsel_rd_timing_X;
	unsigned short phy_dqs_tsel_wr_timing_X;
	//Data Slice Parameters for Gate Leveling
	unsigned short phy_gtlvl_back_step_X;
	unsigned short phy_gtlvl_dly_step_X;
	unsigned short phy_gtlvl_final_step_X;
	unsigned short phy_gtlvl_lat_adj_start_X;
	unsigned short phy_gtlvl_rddqs_slv_dly_start_X;
	unsigned short phy_gtlvl_resp_wait_cnt_X;
	//Data Slice Parameters for Master Delay
	unsigned short phy_master_delay_start_X;
	unsigned short phy_master_delay_step_X;
	unsigned short phy_master_delay_wait_X;
	//Data Slice Parameters for Read DQ/DQS
	unsigned int phy_rddata_en_dly_X;
	unsigned int phy_rddata_en_ie_dly_X;
	unsigned int phy_rddata_en_tsel_dly_X;
	unsigned int phy_rddqZ_slave_delay_X ;
	unsigned int phy_rddqs_dm_fall_slave_delay_X;
	unsigned int phy_rddqs_dm_rise_slave_delay_X;
	unsigned int phy_rddqs_dqZ_fall_slave_delay_X ;
	unsigned int phy_rddqs_dqZ_rise_slave_delay_X;
	unsigned int phy_rddqs_gate_slave_delay_X;
	unsigned int phy_rddqs_latency_adjust_X;
	//Data Slice Parameters for Read Leveling
	unsigned int phy_rdlvl_dly_step_X;
	unsigned int phy_rdlvl_rddqs_dq_slv_dly_start_X;
	//Data Slice Parameters
	unsigned int phy_ie_mode_X;
	unsigned int phy_rptr_update_X;
	unsigned int phy_sw_master_mode_X;
	unsigned int phy_write_path_lat_add_X;
	//Data Slice Parameters for Write Leveling
	unsigned int phy_wrlvl_delay_early_threshold_X;
	unsigned int phy_wrlvl_delay_period_threshold_X;
	unsigned int phy_wrlvl_dly_step_X;
	unsigned int phy_wrlvl_early_force_zero_X;
	unsigned int phy_wrlvl_resp_wait_cnt_X;
}CANDS_PHY_TIMING_T;

